<admintpl file="header" />
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li class="active"><a href="{:U('order/index')}">订单列表</a></li>
	 <li style="margin-left: 1025px;"><a href="javascript:excel()">导出订单</a></li>
  </ul>  
  <form class="well form-search" method="post" action="{:u('order/index')}">
    <div class="search_type cc mb10">
      <div class="mb10">
        关键字：<input type="text" class="input length_2" name="keyword" style="width:200px;" value="{$keyword}" placeholder="请输入关键字...">
		回收方式：<select name="status">  
					  <option value ="">选择回收方式</option>  
					  <option <?php if($status == '0'){?> selected="selected" <?php }?> value ="0">上门回收</option>  
					  <option <?php if($status == '1'){?> selected="selected" <?php }?> value ="1">邮件回收</option> 
				  </select> 
		订单状态：<select name="type">  
					  <option value ="">请选择订单状态</option>  
					  <option <?php if($type == '1'){?> selected="selected" <?php }?> value ="1">以完成</option>  
					  <option <?php if($type == '0'){?> selected="selected" <?php }?>  value ="0">进行中</option> 
				  </select>  				  
        <input type="button" onclick="search()" class="btn" value="搜索"/>
        </span>
      </div>
    </div>
  </form>
  
  <form class="form-horizontal J_ajaxForm" action="" method="post">
    <div class="table_list">
      <table width="100%" class="table table-hover">
        <thead>
	          <tr>
	            <th width="200">订单号/卖家信息</th>
                <th>手机型号</th>
	            <th>联系电话</th>                
                <th>订单价</th>
                <th>订单方式/状态</th>
	            <th>下单时间</th>
	            <th>操作</th>
	          </tr>
        </thead><foreach name="order" item="vo">
        <tr>
            <td width="20">
			<a href="{:U('Order/detail',array('id'=>$vo['id']))}">{$vo.id}</a>|
			<a href="{:U('Order/user',array('id'=>$vo['id']))}">查看卖家信息</a>
			</td>
            <td><strong>{$vo.pname}</strong></td>
            <td>{$vo.mobile}</td>
            <td><span class="fa fa-yen"></span> {$vo.price}</td>
			<td>
				<?php if($vo['way']) {?> 邮件回收  <?php if($vo['status'] == -1) {?> <span  style="color:red;">(未发货)</span> <?php }?><?php }else{?>  上门回收 <?php }?>
            </td>
            <td>
                {$vo.ctime}
            </td>
			<td>
			
				<if condition="$vo['way'] eq 1"> 
					<if condition="$vo['status'] eq 1"> 
						已完成
					</if>
					<if condition="$vo['status'] eq 0"> 
						进行中|<a data-msg="确定付款吗？" href="{:U('Order/price',array('id'=>$vo['id']))}">确认付款</a>
					</if>
					<if condition="$vo['status'] eq -1"> 
						未收货|<a  data-msg="确定收货吗？" href="{:U('Order/update',array('id'=>$vo['id']))}">确认收货</a>
					</if>
				<else />
					<if condition="$vo['status'] eq 1"> 
						已完成
					<else />
						进行中|<a data-msg="确定收货吗？" href="{:U('Order/price',array('id'=>$vo['id']))}">确认收完</a>
					</if>
				</if>
				
            </td>
        </tr></foreach>
          </table>
      <div class="p10"><div class="pages">  </div> </div>
    </div>
  	</form>
</div>
<script src="__ROOT__/statics/js/common.js?"></script>
<script>
	function excel() {
		$('.form-search').attr('action',"{:U('order/excel')}");
        $('.form-search').submit();
    }
	function search() {
		$('.form-search').attr('action',"{:U('order/index')}");
        $('.form-search').submit();
    }
</script>
</body>
</html>